<h4>Links</h4>
<hr>
<ul>
    <?php if (isset($data)) {
        ?>
        <?php
        foreach ($headers as $header) {
            echo "<li><h5>" . $header . "</h5></li>";
            echo "<ul>";
            foreach ($data as $link) {
//        echo $link['link'];
                if ($link['header'] == $header) {
                    if (strcasecmp($link['type'], $type) == 0) {
                        echo "<li>";
                        echo "<i class='icon-link'></i>";
                        echo "<a href=" . $link['link'] . " target = '_blank'><b><u>";
                        echo $link['name'];
                        echo "</u></b></a> - " . $link['description'];
                        echo "</li>";
                    } else {
                        echo "<li>";
                        echo "<i class='icon-link'></i>";
                        echo "<a href=" . $link['link'] . " target = '_blank'>";
                        echo $link['name'];
                        echo "</a> - " . $link['description'];
                        echo "</li>";
                    }
                }
                continue;
            }
            echo "</ul>";
        }
        ?>
    </ul>
    <?php
} else {
    echo "No links available!";
}
?>
